from django.core.mail import send_mail

from celery_tasks.main import app


@app.task(name="send_verify_mail")
def send_verify_mail(subject, html_message, recipient_list):
    subject = subject
    message = ""
    from_email = "gfs1528@126.com"
    recipient_list = recipient_list
    html_message = html_message
    try:
        send_mail(subject=subject, message=message, html_message=html_message, from_email=from_email,
                  recipient_list=recipient_list)
    except Exception as e:
        print("发送邮件失败", e)
